<%@ page language="java"
 import="com.jju.A1541.dao.*"
                  import="java.util.*"
                  import="com.jju.A1541.model.*"
   contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type"
     content="text/html; charset=UTF-8">
<title>用户信息</title>
</head>
<body>
     <p>用户信息管理
        <table border="1">
        	<thead>
        		<th>username</th>
        		<th>tel</th>
        		<th>password</th>
        		<th>操作</th>
        	</thead>
        
           <tbody>
               
           <%
                String keyword="";
                List<User> data =null;
              //区分访问该页面是直接访问 还是表单查询提交
             if(request.getParameter("keyword")==null){
            	  data =UserDAO.getAll(); //取所有记录
             } else { //传递了关键字,根据关键字查询
            	  keyword = request.getParameter("keyword");
            	//通过String类的构造方法，指定的字符串为“UTF-8”编码
          	     keyword= new String(keyword.getBytes("ISO-8859-1"),"UTF-8");
             }
                 //遍历系统中所有的商品分类信息
                for(User obj:data){
                	 out.println("<tr>");
                	 out.println("<td>"+obj.getUsername()+"</td>");
                	 out.println("<td>"+obj.getPassword()+"</td>");
                	 out.println("<td>"+obj.getTel()+"</td>");
                }
           %>
           </tbody>
        </table>





</body>
</html>